package com.zimin.cloud.wiki.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.zimin.cloud.mine.pojo.wiki.view.DocVO;
import com.zimin.cloud.wiki.pojo.entity.Doc;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 文档 Mapper 接口
 * </p>
 *
 * @author zimin
 * @since 2021-10-27 21:02
 */
public interface DocMapper extends BaseMapper<Doc> {

    @Select(" SELECT *,cont.content FROM  wiki_doc doc " +
            " LEFT JOIN  wiki_content cont " +
            " ON doc.id = cont.id ${ew.customSqlSegment}")
    DocVO getDocContent(@Param(Constants.WRAPPER) Wrapper wrapper);
}
